{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport * as React from 'react';\nimport ResizableTextArea from './ResizableTextArea';\nvar TextArea = /*#__PURE__*/function (_React$Component) {\n  _inherits(TextArea, _React$Component);\n  var _super = _createSuper(TextArea);\n  function TextArea(props) {\n    var _this;\n    _classCallCheck(this, TextArea);\n    _this = _super.call(this, props);\n    _this.resizableTextArea = void 0;\n    _this.focus = function () {\n      _this.resizableTextArea.textArea.focus();\n    };\n    _this.saveTextArea = function (resizableTextArea) {\n      _this.resizableTextArea = resizableTextArea;\n    };\n    _this.handleChange = function (e) {\n      var onChange = _this.props.onChange;\n      _this.setValue(e.target.value);\n      if (onChange) {\n        onChange(e);\n      }\n    };\n    _this.handleKeyDown = function (e) {\n      var _this$props = _this.props,\n        onPressEnter = _this$props.onPressEnter,\n        onKeyDown = _this$props.onKeyDown;\n      if (e.keyCode === 13 && onPressEnter) {\n        onPressEnter(e);\n      }\n      if (onKeyDown) {\n        onKeyDown(e);\n      }\n    };\n    var value = typeof props.value === 'undefined' || props.value === null ? props.defaultValue : props.value;\n    _this.state = {\n      value: value\n    };\n    return _this;\n  }\n  _createClass(TextArea, [{\n    key: \"setValue\",\n    value: function setValue(value, callback) {\n      if (!('value' in this.props)) {\n        this.setState({\n          value: value\n        }, callback);\n      }\n    }\n  }, {\n    key: \"blur\",\n    value: function blur() {\n      this.resizableTextArea.textArea.blur();\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      return /*#__PURE__*/React.createElement(ResizableTextArea, _extends({}, this.props, {\n        value: this.state.value,\n        onKeyDown: this.handleKeyDown,\n        onChange: this.handleChange,\n        ref: this.saveTextArea\n      }));\n    }\n  }], [{\n    key: \"getDerivedStateFromProps\",\n    value: function getDerivedStateFromProps(nextProps) {\n      if ('value' in nextProps) {\n        return {\n          value: nextProps.value\n        };\n      }\n      return null;\n    }\n  }]);\n  return TextArea;\n}(React.Component);\nexport { ResizableTextArea };\nexport default TextArea;","map":{"version":3,"names":["_extends","_classCallCheck","_createClass","_inherits","_createSuper","React","ResizableTextArea","TextArea","_React$Component","_super","props","_this","call","resizableTextArea","focus","textArea","saveTextArea","handleChange","e","onChange","setValue","target","value","handleKeyDown","_this$props","onPressEnter","onKeyDown","keyCode","defaultValue","state","key","callback","setState","blur","render","createElement","ref","getDerivedStateFromProps","nextProps","Component"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-textarea/es/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport * as React from 'react';\nimport ResizableTextArea from './ResizableTextArea';\nvar TextArea = /*#__PURE__*/function (_React$Component) {\n  _inherits(TextArea, _React$Component);\n  var _super = _createSuper(TextArea);\n  function TextArea(props) {\n    var _this;\n    _classCallCheck(this, TextArea);\n    _this = _super.call(this, props);\n    _this.resizableTextArea = void 0;\n    _this.focus = function () {\n      _this.resizableTextArea.textArea.focus();\n    };\n    _this.saveTextArea = function (resizableTextArea) {\n      _this.resizableTextArea = resizableTextArea;\n    };\n    _this.handleChange = function (e) {\n      var onChange = _this.props.onChange;\n      _this.setValue(e.target.value);\n      if (onChange) {\n        onChange(e);\n      }\n    };\n    _this.handleKeyDown = function (e) {\n      var _this$props = _this.props,\n        onPressEnter = _this$props.onPressEnter,\n        onKeyDown = _this$props.onKeyDown;\n      if (e.keyCode === 13 && onPressEnter) {\n        onPressEnter(e);\n      }\n      if (onKeyDown) {\n        onKeyDown(e);\n      }\n    };\n    var value = typeof props.value === 'undefined' || props.value === null ? props.defaultValue : props.value;\n    _this.state = {\n      value: value\n    };\n    return _this;\n  }\n  _createClass(TextArea, [{\n    key: \"setValue\",\n    value: function setValue(value, callback) {\n      if (!('value' in this.props)) {\n        this.setState({\n          value: value\n        }, callback);\n      }\n    }\n  }, {\n    key: \"blur\",\n    value: function blur() {\n      this.resizableTextArea.textArea.blur();\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      return /*#__PURE__*/React.createElement(ResizableTextArea, _extends({}, this.props, {\n        value: this.state.value,\n        onKeyDown: this.handleKeyDown,\n        onChange: this.handleChange,\n        ref: this.saveTextArea\n      }));\n    }\n  }], [{\n    key: \"getDerivedStateFromProps\",\n    value: function getDerivedStateFromProps(nextProps) {\n      if ('value' in nextProps) {\n        return {\n          value: nextProps.value\n        };\n      }\n      return null;\n    }\n  }]);\n  return TextArea;\n}(React.Component);\nexport { ResizableTextArea };\nexport default TextArea;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAOC,SAAS,MAAM,qCAAqC;AAC3D,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,IAAIC,QAAQ,GAAG,aAAa,UAAUC,gBAAgB,EAAE;EACtDL,SAAS,CAACI,QAAQ,EAAEC,gBAAgB,CAAC;EACrC,IAAIC,MAAM,GAAGL,YAAY,CAACG,QAAQ,CAAC;EACnC,SAASA,QAAQ,CAACG,KAAK,EAAE;IACvB,IAAIC,KAAK;IACTV,eAAe,CAAC,IAAI,EAAEM,QAAQ,CAAC;IAC/BI,KAAK,GAAGF,MAAM,CAACG,IAAI,CAAC,IAAI,EAAEF,KAAK,CAAC;IAChCC,KAAK,CAACE,iBAAiB,GAAG,KAAK,CAAC;IAChCF,KAAK,CAACG,KAAK,GAAG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